package com.cyzy.controller;

import com.cyzy.domain.dto.ResponseData;
import com.cyzy.domain.query.ShowBaseList;
import com.cyzy.service.LandService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/land")
@RequiredArgsConstructor
public class LandController {
    @Autowired
    private LandService landService;
    /**
     * 空闲地显示基地
     * @param showBaseList  空闲地显示参数实体类
     * @return 符合的条件的基地 返回前端
     */
    @PostMapping("showBaseList")
    public ResponseData showBaseList(@RequestBody ShowBaseList showBaseList){
        ResponseData data = landService.showBaseList(showBaseList);
        return data;
    }
    /**
     * 基地详情页  种子选择
     * @return 返回根据类型的种子(比如蔬菜区,果树区)
     */
    @GetMapping("showSeedList")
    public ResponseData showSeedList(String baseType){
        ResponseData data = landService.showSeedList(baseType);
        return data;
    }
    @RequestMapping("test")
    public ResponseData test(){
        return ResponseData.success();
    }


}
